{% extends "empty_page.html" %}
{% load i18n %}
{% load staticfiles %}
{% load special_character %}
{% block title %} {% trans "report" %} {% endblock %}
<!DOCTYPE html>

{% block body %}
<script src="{{ STATIC_URL }}js/holder.min.js"></script>

<head>

    <style type="text/css">

        .report {font-size: 85%;
                width:80%;
                margin: 0 auto; 
                
                }
        
        td      {
                text-align:center;

                }
        table{
                border-collapse:collapse;
            }

        #nritem {
            text-align: center;
            border: #cbcbcc solid 1px;
        }
        #nritem ul {
            margin: 0px;
            padding: 0px;
            list-style-type: none;
        }
        #nritem ul li {
            float:left;
            display: inline;
            margin-left:5px;
            margin-right:5px;
        }
        #nritem ul img
        {
            display:block;
            margin:0 auto; 
            border:0;
        }
        #break{
            clear:both;
        }
    </style>
</head>

<div class="report">
{% if redirecturl %}
<a class="btn btn-default btn-sm" href="{{redirecturl}}"> {% trans "back" %}</a>
{% endif %}
<a class="btn btn-sm btn-success pull-right" href="{% url generate_technology_subpicture_pdf operation_group.id %}" target="_blank">{% trans 'download pdf' %}</a>
<div class="clearfix"></div>
<br>
<table class="table table-bordered" cellpadding ="0">
    <tr>
        <td colspan='2' rowspan="2">康春机械</td>
        <td colspan='3' rowspan="2">机械加工工艺过程卡</td>
        <td colspan='2'>产品代号</td>
        <td colspan='2'>图号</td>
        <td colspan='2'>零、部、组(整体)件名称</td>
        <td>工序号</td>
        <td>工序名称</td>
        <td>工艺文件编号</td>   
        <td>版本号</td>              
    </tr>

    <tr>                         
        <td colspan='2'>{{ operation_group.technology.product.symbol }}</td>
        <td colspan='2'>{{ operation_group.technology.product.cad_code }}</td>
        <td colspan='2'>{{ operation_group.technology.product.name }}</td>
        <td>{{ operation_group.order }}</td>
        <td>{{ operation_group.name }}</td>
        <td>{{ operation_group.technology.file_code }}</td>
        <td>{{ technology.rev_order }}</td>
    </tr>

    <tr>
        <td colspan='11' rowspan="8" id="nritem">
            <ul>
            <li>
            {% if operation_group.TU1_file %}
                <img src="{{ MEDIA_URL }}{{ operation_group.TU1_file.data }}" width='180' height='150'>
                <!--{#<a class="btn btn-primary btn-sm active" href="{% url download_directory_file operation_group.images.0.id %}">下载文件</a>#}-->
            {% else %}
                <img src="holder.js/180x150/">
            {% endif %}
            </li>
            <li>
            {% if operation_group.TU2_file %}
                <img src="{{ MEDIA_URL }}{{ operation_group.TU2_file.data }}" width='180' height='150'>
                <!--{#<a class="btn btn-primary btn-sm active" href="{% url download_directory_file operation_group.images.1.id %}">下载文件</a>#}-->
            {% else %}
                <img src="holder.js/180x150/">
            {% endif %}
            </li>
            <li>
            {% if operation_group.TU3_file %}
                <img src="{{ MEDIA_URL }}{{ operation_group.TU3_file.data }}" width='180' height='150'>
                <!--{#<a class="btn btn-primary btn-sm active" href="{% url download_directory_file operation_group.images.2.id %}">下载文件</a>#}-->
            {% else %}
                <img src="holder.js/180x150/">
            {% endif %}
            </li>
            </ul>
        </td>
        <td colspan='4'>
            设备编号
            <tr><td colspan='4'>{% if operation_group.device.type != '0' %}{{ operation_group.device.type|default_if_none:"" }}{% endif %}&nbsp;</td></tr>
            <tr><td colspan='4'>冷却液</td></tr>
            <tr><td colspan='4'>{{ operation_group.coolant|default_if_none:"" }}&nbsp;</td></tr>
            <tr><td colspan='4'>材料牌号</td></tr>
            <tr><td colspan='4'>{{ operation_group.material_mark|default_if_none:"" }}&nbsp;</td></tr>
            <tr><td colspan='4'>夹具</td></tr>
            <tr><td colspan='4'>{{ operation_group.fixture|default_if_none:"" }}&nbsp;</td></tr>
        </td>
    </tr>

    <tr>
        <td>工步号</td>
        <td colspan='10'>工步名称及内容</td>
        <td colspan='4'>工艺装备</td>
    </tr>

    {% for operation in operation_group.operations.all %}
    <tr>
        <td>{{ operation.order }}</td>
        <td colspan='10' style="text-align:center;vertical-align:middle;">{{ operation.name }}, {% convert_special_character_tag operation.description %}</td>
        <td colspan='4'>{{ operation.equipment|default_if_none:"" }}&nbsp;</td>
    </tr>
    {% endfor %}

    <tr>
        <td>描图</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>阶段标记</td>
    </tr>

    <tr>
        <td rowspan='2'>描较</td>
        <td rowspan='2'></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>编制</td>
        <td>审核</td>
        <td>标准化</td>
        <td>会签</td>
        <td>批准</td>
        <td></td>
    </tr>

    <tr>
      
        <td>&nbsp;</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>{{ operation_group.technology.bianzhi.executor.last_name }}{{ operation_group.technology.bianzhi.executor.first_name }}</td>
        <td>{{ operation_group.technology.shenhe.executor.last_name }}{{ operation_group.technology.shenhe.executor.first_name }}</td>
        <td>{{ operation_group.technology.biaozhunhua.executor.last_name }}{{ operation_group.technology.biaozhunhua.executor.first_name }}</td>
        <td>{{ operation_group.technology.huiqian.executor.last_name }}{{ operation_group.technology.huiqian.executor.first_name }}</td>
        <td>{{ operation_group.technology.pizhun.executor.last_name }}{{ operation_group.technology.pizhun.executor.first_name }}</td>
        <td></td>
    </tr>

    <tr>
        <td></td>
        <td>更改标记</td>
        <td>更改单号</td>
        <td>签名</td>
        <td>日期</td>
        <td>更改标记</td>
        <td>更改单号</td>
        <td>签名</td>
        <td>日期</td>
        <td>{{ operation_group.technology.bianzhi.date_added.date|date:"Y-m-d" }}</td>
        <td>{{ operation_group.technology.shenhe.date_added.date|date:"Y-m-d" }}</td>
        <td>{{ operation_group.technology.biaozhunhua.date_added.date|date:"Y-m-d" }}</td>
        <td>{{ operation_group.technology.huiqian.date_added.date|date:"Y-m-d" }}</td>
        <td>{{ operation_group.technology.pizhun.date_added.date|date:"Y-m-d" }}</td>
        <td></td>
    </tr>

</table>
</div>

{% endblock %}
</html>